package cn.tedu.spring.dibase;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TextUserDao {
    public static void main(String[] args) {
        /**
         * 1.让Spring Framework框架创建IoC容器,并把创建的Spring Bean对象放入到IoC容器中
         * 2.通过getBean方法从IoC容器中获取对象
         * 3.调用对象的方法
         */
        AnnotationConfigApplicationContext acac = new AnnotationConfigApplicationContext("cn/tedu/spring/dibase");
        UserDao userDao = acac.getBean(UserDao.class);
        System.out.println("userDao = " + userDao);
    }
}
